package com.hx.demo.httpdemo;

import com.hx.demo.User;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

/**
 * @author Huathy
 * @date 2021-10-14 23:10
 * @description
 */
public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",8888);
        User user = new User("Huathy",18);
        ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
        oos.writeObject(user);
        socket.close();
    }
}
